home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Utilities / Text and Speech / BBEdit 2.2.2 / BBEdit Extensions / Sources / HelloWorld.c < prev    next >
C/C++ Source or Header  |  1992-09-02  |  429b  |  20 lines

  1. #include "ExternalInterface.h"
  2.  
  3. /*
  4.     This trivial extension shows the use of NewDocument(),
  5.     Allocate(), and SetWindowContents().
  6. */
  7.  
  8. pascal void main(ExternalCallbackBlock *callbacks, WindowPtr w)
  9. {
  10.     Handle h;
  11.     
  12.     w = callbacks->NewDocument();
  13.     if (w) {
  14.         h = callbacks->Allocate(0, FALSE);
  15.         SetIText(h, "\pHello World");
  16.         callbacks->SetWindowContents(w, h);
  17.         //    do NOT dispose of "h", since it now belongs to the window!
  18.     }
  19. }
  20.